/* ------------------- 基础样式 ------------------- */
:root {
  --primary-color: #4CAF50;      /* 主色调：绿色，代表新鲜 */
  --secondary-color: #FF9800;    /* 辅助色：橙色，代表促销 */
  --accent-color: #E53935;       /* 强调色：红色，用于重要提示 */
  --text-color: #333333;         /* 正文文本颜色 */
  --text-light: #666666;         /* 次要文本颜色 */
  --text-lighter: #999999;        /* 浅色文本颜色 */
  --bg-color: #F5F5F5;           /* 背景颜色 */
  --bg-white: #FFFFFF;           /* 白色背景 */
  --border-color: #EEEEEE;       /* 边框颜色 */
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* 阴影 */
  --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.1); /* 悬停阴影 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--bg-color);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ------------------- 按钮样式 ------------------- */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.primary-btn {
  background-color: var(--primary-color);
  color: white;
}

.primary-btn:hover {
  background-color: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.secondary-btn {
  background-color: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
  background-color: #f0f9f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ------------------- 顶部通知栏 ------------------- */
.top-notification {
  background-color: var(--primary-color);
  color: white;
  padding: 10px 0;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ------------------- 头部导航 ------------------- */
.header {
  background-color: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.header.scrolled {
  height: 60px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.logo i {
  margin-right: 8px;
  font-size: 28px;
}

/* ------------------- 桌面端导航 ------------------- */
.desktop-nav {
  display: flex;
}

.nav-list {
  display: flex;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 0 15px;
  height: 70px;
  line-height: 70px;
  color: var(--text-color);
  font-size: 16px;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover, .nav-item.active .nav-link {
  color: var(--primary-color);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15px;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-item.active .nav-link::after {
  width: calc(100% - 30px);
}

.has-submenu .nav-link::after {
  content: '\f107';
  font-family: 'FontAwesome';
  margin-left: 5px;
  font-size: 12px;
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  padding: 10px 0;
  width: 180px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10;
}

.nav-item:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.submenu li {
  margin: 0;
}

.submenu a {
  display: block;
  padding: 8px 20px;
  color: var(--text-light);
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.submenu a:hover {
  background-color: #f5f5f5;
  color: var(--primary-color);
}

/* ------------------- 功能区 ------------------- */
.function-area {
  display: flex;
  align-items: center;
}

.function-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-light);
  margin-left: 15px;
  position: relative;
  transition: color 0.3s ease;
}

.function-item:hover {
  color: var(--primary-color);
}

.cart-count {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-button {
  display: none;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 24px;
  cursor: pointer;
  margin-left: 15px;
}

/* ------------------- 移动端导航 ------------------- */
.mobile-menu {
  display: none;
  border-top: 1px solid var(--border-color);
  background-color: white;
}

.mobile-nav-list {
  padding: 10px 0;
}

.mobile-nav-item {
  position: relative;
  border-bottom: 1px solid #f5f5f5;
}

.mobile-nav-link {
  display: block;
  padding: 12px 20px;
  color: var(--text-color);
  font-size: 16px;
  position: relative;
  transition: background-color 0.3s ease;
}

.mobile-nav-link:hover, .mobile-nav-item.active .mobile-nav-link {
  background-color: #f5f5f5;
  color: var(--primary-color);
}

.has-submenu .mobile-nav-link::after {
  content: '\f105';
  font-family: 'FontAwesome';
  position: absolute;
  right: 20px;
  transition: transform 0.3s ease;
}

.mobile-nav-item.active .has-submenu .mobile-nav-link::after {
  transform: rotate(90deg);
}

.mobile-submenu {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-nav-item.active .mobile-submenu {
  max-height: 500px;
  padding: 10px 20px;
}

.mobile-submenu a {
  display: block;
  padding: 8px 0;
  color: var(--text-light);
  font-size: 14px;
  transition: color 0.3s ease;
}

.mobile-submenu a:hover {
  color: var(--primary-color);
}

/* ------------------- 主横幅 ------------------- */
.banner {
  height: 500px;
  background: linear-gradient(to right, rgba(76, 175, 80, 0.1), rgba(255, 152, 0, 0.1));
  position: relative;
  overflow: hidden;
}

.banner-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.banner-title {
  font-size: 48px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 20px;
  line-height: 1.2;
}

.banner-desc {
  font-size: 20px;
  color: var(--text-light);
  margin-bottom: 30px;
  max-width: 600px;
}

.banner-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

/* ------------------- 通用section样式 ------------------- */
.section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-size: 32px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 10px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.more-link {
  display: inline-block;
  color: var(--primary-color);
  font-size: 16px;
  position: relative;
  padding-right: 20px;
  transition: color 0.3s ease;
}

.more-link:hover {
  color: #388e3c;
}

.more-link::after {
  content: '\f105';
  font-family: 'FontAwesome';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* ------------------- 产品展示 ------------------- */
.products-container {
  display: flex;
  gap: 30px;
}

.product-category {
  flex: 1;
}

.category-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
  display: flex;
  align-items: center;
}

.category-title i {
  margin-right: 10px;
  color: var(--primary-color);
}

.category-desc {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.product-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.product-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.new-badge, .promotion-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: bold;
  color: white;
  border-radius: 4px;
}

.new-badge {
  background-color: var(--secondary-color);
}

.promotion-badge {
  background-color: var(--primary-color);
}

.product-info {
  padding: 15px;
}

.product-name {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 10px;
  display: -webkit-box;
  line-clamp: 2; 
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent-color);
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-item {
  display: flex;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-item:hover {
  box-shadow: var(--shadow-hover);
}

.product-item .product-image {
  width: 180px;
  height: 120px;
}

.product-details {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-spec {
  font-size: 14px;
  color: var(--text-light);
  margin: 5px 0 10px;
  display: -webkit-box;
  line-clamp: 2; 
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------- 分类导航 ------------------- */
.category-section {
  background-color: var(--bg-white);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.category-item {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  text-align: center;
}

.category-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.category-image {
  width: 80px;
  height: 80px;
  margin-bottom: 15px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
}

.category-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.category-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 10px;
}

.category-subcategories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.category-subcategories a {
  font-size: 12px;
  color: var(--text-light);
  padding: 3px 8px;
  border-radius: 15px;
  background-color: #f0f0f0;
  transition: all 0.3s ease;
}

.category-subcategories a:hover {
  background-color: var(--primary-color);
  color: white;
}

/* ------------------- 专题推荐 ------------------- */
专题-section {
  background-color: var(--bg-color);
}

专题-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

专题-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

专题-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

专题-image {
  height: 200px;
  overflow: hidden;
}

专题-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

专题-card:hover .专题-img {
  transform: scale(1.05);
}

专题-info {
  padding: 15px;
}

专题-title {
  font-size: 18px;
  color: var(--text-color);
  margin-bottom: 10px;
  display: -webkit-box;
  line-clamp: 2; 
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

专题-price {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent-color);
  margin-bottom: 15px;
}

专题-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-weight: bold;
  color: var(--text-color);
  display: block;
  margin-bottom: 3px;
}

/* ------------------- 优势介绍 ------------------- */
.advantages-section {
  background-color: white;
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.advantage-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.advantage-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(76, 175, 80, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--primary-color);
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.advantage-item:hover .advantage-icon {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-5px);
}

.advantage-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 10px;
}

.advantage-desc {
  font-size: 14px;
  color: var(--text-light);
}

/* ------------------- 页脚 ------------------- */
.footer {
  background-color: #f8f8f8;
  padding: 40px 0 20px;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 30px;
}

.footer-column {
  flex: 1;
  min-width: 200px;
}

.footer-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-light);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.contact-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 5px;
}

.contact-item i {
  margin-right: 10px;
  color: var(--primary-color);
}

.contact-time {
  font-size: 14px;
  color: var(--text-light);
}

.qr-code-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qr-code {
  text-align: center;
}

.qr-code-img {
  width: 120px;
  height: 120px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  padding: 5px;
  background-color: white;
}

.qr-code-text {
  font-size: 14px;
  color: var(--text-light);
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-bottom .footer-links {
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
}

.copyright {
  font-size: 14px;
  color: var(--text-lighter);
}

/* ------------------- 动画效果 ------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.slide-up {
  animation: slideUp 0.8s ease forwards;
}

.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}
